//
//  BaseViewController.m
//  SPDemo
//
//  Created by Sailer Guo on 2020/1/6.
//  Copyright © 2020 Sailer Guo. All rights reserved.
//

#import "BaseViewController.h"
#import "Environment.h"
#import <AFNetworking.h>

@interface BaseViewController ()

@end

@implementation BaseViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    [[Environment sharedInstance].apiService.errors subscribeNext:^(id  _Nullable x) {
        // 所有请求失败都会被发送到这里
        
    }];
    
    [[Environment sharedInstance].networkMonitoringSignal subscribeNext:^(id  _Nullable x) {
        // 网络变化会调用这里
        AFNetworkReachabilityStatus status = [x integerValue];
        
    }];
    
    
    
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
